#include "stdheader.h"
#include "CServer.h"
#include "QQServerUI.h"
CServer*server;

int main(int argc,char**argv)
{
	
	QQServerUI*lpQQServerUI;
	//ZP_DEBUG
	//GtkWidget*windows;
	////ZP_DEBUG_END
	if (!g_thread_supported ()) 
	{
		g_thread_init (NULL);
		gdk_threads_init();
	}
	gtk_init(&argc, &argv);
	
	lpQQServerUI=QQServerUI_new();
	QQServerUI_Init(lpQQServerUI);

	server=CServer_new();
	server->UIClientListChangeQueue=lpQQServerUI->lpClientDataChangeQueue;
	QQServerUI_Run(lpQQServerUI);
/*
	CServer_Start(server);
	gdk_threads_enter();
	gtk_main();
	gdk_threads_leave();
	////////////////////////////////////////////////////////////////////////////
	
	windows=glade_xml_get_widget(lpQQServerUI->GUI,"window_main");
	
	gtk_widget_show(windows);
	glade_xml_signal_autoconnect(lpQQServerUI->GUI);
	gdk_threads_enter();
	gtk_main();
	gdk_threads_leave();
	
	g_object_unref (G_OBJECT (lpQQServerUI->GUI));
*/

	return 0;
}
int WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd )
{
	int argc;
	char *argv=NULL;
	return main(argc,argv);
}